/* SPDX-License-Identifier: GPL-2.0 */
/*
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: c_can driver Vendor Hooks
 */

#ifdef CONFIG_NETBIOS_C_CAN_SPEC

#if !defined(C_CAN_EXT_H) || defined(TRACE_HEADER_MULTI_READ)
#define C_CAN_EXT_H
#include <linux/netdevice.h>
void trace_can_set_bit_conf(u32 *reg_btr, u32 *reg_brpe);
void trace_can_set_iomg_conf(struct net_device *dev);
int trace_can_init_priv_resource(struct net_device *dev);
void trace_can_free_priv_resource(struct net_device *dev);
void trace_can_add_pkt_count(struct net_device *dev, struct can_frame *frame);
#endif

#else

#include <linux/tracepoint.h>
struct net_device;

DECLARE_EVENT_NOP(can_set_bit_conf,
					TP_PROTO(u32 *reg_btr, u32 *reg_brpe),
					TP_ARGS(reg_btr, reg_brpe));

DECLARE_EVENT_NOP(can_set_iomg_conf,
					TP_PROTO(struct net_device *dev),
					TP_ARGS(dev));

static inline int trace_can_init_priv_resource(struct net_device *dev)
{
	return 0;
}

DECLARE_EVENT_NOP(can_free_priv_resource,
					TP_PROTO(struct net_device *dev),
					TP_ARGS(dev));

DECLARE_EVENT_NOP(can_add_pkt_count,
					TP_PROTO(struct net_device *dev, struct can_frame *frame),
					TP_ARGS(dev, frame));
#endif
